{% if debug %}
<html>
<head>
<style type="text/css">
	@import "/site_media/dojo/dojo/resources/dojo.css";
	@import "/site_media/dojo/dijit/themes/tundra/tundra.css";
</style>
<script type="text/javascript" src="/site_media/dojo/dojo/dojo.js" 
	djConfig = "parseOnLoad:true, extraLocale:['en-gb']"></script>
<script type="text/javascript" src="/site_media/js/serpantin.js"></script>
<script language="JavaScript" type="text/javascript">
	dojo.require("dojo.parser");
	dojo.require("dijit.layout.LayoutContainer");
	dojo.require("dijit.layout.ContentPane");
	dojo.require("dijit.layout.TabContainer");
	dojo.require("dijit.layout.SplitContainer");
	dojo.require("dijit.layout.AccordionContainer");
	dojo.require("dijit.form.ComboBox");
	dojo.require("dijit.form.Button");
	dojo.require("dijit.form.DateTextBox");
	dojo.require("dijit.form.FilteringSelect");

	dojo.require("dojox.data.QueryReadStore");

	dojo.provide("CustomQueryReadStore");
	dojo.declare("CustomQueryReadStore", dojox.data.QueryReadStore, {
		fetch:function(request) {
			request.serverQuery = {q:request.query.name};
			return this.inherited("fetch", arguments);
		}
	});
</script>
</head>
<body class="tundra">
{% endif %}

{% load i18n %}
<script type='text/javascript'>
</script>
<div class="Org" style="width: 400; height: 200;">
<div class="help"><a href="http://localhost/nwiki/serp2/common/Org">HELP</a></div>
<form id="fpform_{{ win_id }}" app="common" model="Org" oid="{{obj.id}}" class="fpform" method="POST">
<table>
  <tr><td>
    <label for="id_alias">Name:</label></td>
    <td>
    {{ form.alias }}
    {% if form.alias.errors %}
      *** {{ form.alias.errors|join:", " }}
    {% endif %}
    <label for="id_code">Code:</label>
    {{ form.code }}
    {% if form.code.errors %}
      *** {{ form.code.errors|join:", " }}
    {% endif %}
  </td></tr>
    <tr><td>    
    <label for="id_type">Legal form:</label></td>
    <td>
    {{ form.type }}&nbsp;<a href="#" onclick="loadSubForm(this,'common','Orgtype','','id_type');"><img src="/media/img/admin/icon_addlink.gif"></a>
    {% if form.type.errors %}
      *** {{ form.type.errors|join:", " }}
    {% endif %}
    <label for="id_name">Name:</label>
    {{ form.name }}
    {% if form.name.errors %}
      *** {{ form.name.errors|join:", " }}
    {% endif %}
  </td></tr>

    <tr><td>    
    <label for="id_fullname">Full name:</label></td>
    <td >
    {{ form.fullname }}
    
    {% if form.fullname.errors %}
      *** {{ form.fullname.errors|join:", " }}
    {% endif %}
  </td></tr>

  <!--tr><td>
    <label for="id_town">City:</label></td><td>

    {{ form.town }}&nbsp;<a href="#" onclick="loadSubForm(this,'common','Town','','id_town');"><img src="/media/img/admin/icon_addlink.gif"></a>
    {% if form.town.errors %}
      *** {{ form.town.errors|join:", " }}
    {% endif %}
  </td></tr -->

    <tr><td>
	<label for="id_info">Info:</label></td>
    <td>
    {{ form.info }}
    {% if form.info.errors %}
      *** {{ form.info.errors|join:", " }}
    {% endif %}
    </td> </tr>


  <tr><td>
    <label for="id_Phones">Phones:</label></td><td>
    {{ form.phones }}
    {% if form.phones.errors %}
      *** {{ form.phones.errors|join:", " }}
    {% endif %}
  </td></tr>



  <tr><td>
    <label for="id_email">E-mail:</label></td>
    <td>
    {{ form.email }}
    {% if form.email.errors %}
      *** {{ form.email.errors|join:", " }}
    {% endif %}
    <label for="id_http">Web site:</label>
    {{ form.http }}
    {% if form.http.errors %}
      *** {{ form.http.errors|join:", " }}
    {% endif %}
  </td></tr>
<tr>
  <td><label for="id_contacted">Contacted:</label></td>
  <td>{{ form.contacted }}</td>
</tr>
  
  <!-- tr><td>
    <label for="id_tags">Tags:</label></td><td>
    {{ form.tags }}
    {% if form.tags.errors %}
      *** {{ form.tags.errors|join:", " }}
    {% endif %}
  </td></tr -->
<tr><td colspan="2">
<div class="box">
<button dojoType="dijit.form.Button" onclick="submitForm('common', 'Org', '{{ object_id }}', {{ win_id }}, 'save');"><span>Save and continue</span></button>
<button dojoType="dijit.form.Button" onclick="this.setDisabled(true); submitForm('common', 'Org', '{{ object_id }}', {{ win_id }}, 'save_and_close');"><span>Save</span></button>
</div>
</td></tr>

<!-- FIXME: get rid of those -->
<tr><td colspan="2">
<input type="hidden" name="createuser" value="1">
<input type="hidden" name="modifyuser" value="1">
{% if debug %}
<input type="submit">
{% endif %}
</td></tr>

</table> 
</form>
<p>{% if obj.createdate %}
		{% trans 'Createdata:' %} {{obj.createdate|date:"F j, Y"}}
		{{obj.createuser.username}}<br/>
    {% endif %}
    {% if obj.modifydate %}
		{% trans 'Modifydata:' %} {{obj.modifydate|date:"F j, Y"}}
		{{obj.modifyuser.username}}<br/>
    {% endif %}
</p>
<p>&nbsp;</p>
</div>

{% if debug %}
</body>
</html>
{% endif %}